//
//  baseTabBarController.m
//  ALS3.0
//
//  Created by 崔 on 2016/12/22.
//  Copyright © 2016年 崔. All rights reserved.
//

#import "baseTabBarController.h"
#import "ALSConstNSString.h"
@interface baseTabBarController ()

@end

@implementation baseTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    //更改文字颜色
    self.tabBar.tintColor = [UIColor colorWithRed:63/255.0 green:235/255.0 blue:235/255.0 alpha:1];
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(als3DTouch) name:ALS3DTouchBeginActionNotification object:nil];
}

- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection {
//    [self setApp3DTouch];
}

- (void)viewWillAppear:(BOOL)animated {
//    [self setApp3DTouch];
}

- (void)als3DTouch {
    [self dismissViewControllerAnimated:YES completion:nil];
}

//- (void)setApp3DTouch {
//    if ([self respondsToSelector:@selector(traitCollection)])
//    {
//        if ([self.traitCollection respondsToSelector:@selector(forceTouchCapability)])
//        {
//            if (self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable)
//            {
//                
//                UIApplicationShortcutIcon *shareIcon = [UIApplicationShortcutIcon iconWithType:UIApplicationShortcutIconTypeShare];
//                UIApplicationShortcutItem *shareItem = [[UIApplicationShortcutItem alloc]initWithType:ALS3DTouchShareType localizedTitle:@"分享“阿里桑门禁”" localizedSubtitle:nil icon:shareIcon userInfo:nil];
//                UIApplicationShortcutIcon *searchIcon = [UIApplicationShortcutIcon iconWithType:UIApplicationShortcutIconTypeSearch];
//                UIApplicationShortcutItem *searchItem = [[UIApplicationShortcutItem alloc]initWithType:ALS3DTouchSearchType localizedTitle:@"秒开搜索" localizedSubtitle:nil icon:searchIcon userInfo:nil];
//                
//                UIApplicationShortcutIcon *cameraIcon = [UIApplicationShortcutIcon iconWithType:UIApplicationShortcutIconTypeCaptureVideo];
//                UIApplicationShortcutItem *cameraItem = [[UIApplicationShortcutItem alloc]initWithType:ALS3DTouchCameraType localizedTitle:@"视频门禁" localizedSubtitle:nil icon:cameraIcon userInfo:nil];
//                
//                [UIApplication sharedApplication].shortcutItems = @[cameraItem,searchItem];
//                
//            }
//            else
//            {
//                // 不支持3D Touch
//                [UIApplication sharedApplication].shortcutItems = nil;
//
//            }
//        }
//    }
//
//}


- (void)viewDidLayoutSubviews{
    
    [super viewDidLayoutSubviews];
    
    CGRect frame = self.tabBar.frame;
    
    frame.size.height = 55;
    
    frame.origin.y = self.view.frame.size.height - frame.size.height;
    
    self.tabBar.frame = frame;
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
